package it.gat.util.dao;

import it.gat.dao.*;

public abstract class DAOFactory {

	public static final int MYSQL = 1;
	
	public static String dbUrl;
	public static String dbUsername;
	public static String dbPassword;

	public abstract ClienteDAO getClienteDAO();
	public abstract SedeDAO getSedeDAO();
	public abstract UtenteDAO getUtenteDAO();
	public abstract ArticoloDAO getArticoloDAO();
	public abstract TipologiaDispositivoDAO getTipologiaDispositivoDAO();
	public abstract TicketDAO getTicketDAO();
	public abstract AppuntamentoDAO getAppuntamentoDAO();
	public abstract RapportoInterventoDAO getRapportoInterventoDAO();
	public abstract DispositivoSostituitoDAO getDispositivoSostituitoDAO();
	public abstract ContrattoDAO getContrattoDAO();
	public abstract PermessoUtenteDAO getPermessoUtenteDAO();
	public abstract PermessoDAO getPermessoDAO();

	public static DAOFactory getDAOFactory(int whichFactory) {

		switch (whichFactory) {
		case MYSQL: 
			return new MySQLDAOFactory();
		default: 
			return null;
		}
	}
	
	public static void setParameter(String dbServer,String dbPort,String dbName,String dbUsername, String dbPassword) {
		DAOFactory.dbUrl="jdbc:mysql://"+dbServer+":"+dbPort+"/"+dbName;
		DAOFactory.dbUsername=dbUsername;
		DAOFactory.dbPassword=dbPassword;
	}
}